package model

import (
	"gorm.io/gorm"
	"zk3/petpal-service/config"
)

type Order struct {
	gorm.Model
	UserID    int    `gorm:"type:int(11);comment:用户ID"`
	PackageId int    `gorm:"type:int(11);comment:服务ID"`
	OrderSn   string `gorm:"type:char(18);comment:订单号"`
	Query     int    `gorm:"type:int(11);comment:订单数量"`
}

func CreateOrder(o *Order) error {

	return config.DB.Create(&o).Error
}
func FindOrder(o *Order, orderSn string) {

	config.DB.Where("order_sn=?", orderSn).Find(&o)
}
